package com.hotel.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import org.springframework.stereotype.Component;

/**
 * @author shkstart 用户实体类
 * @create 2021-06-21 16:38
 */
@Data
@Component
public class User {

    @TableId(type = IdType.ID_WORKER)
    private Long id;//用户id，设置自增
    private String username;//用户名，登录名
    private String password;//登录密码
    private Integer roleId;//所属角色id
    private String phone;//电话号码
    private int sex;//性别0,代表未知，1代表男，2代表女
    private Integer age;//年龄
    private String address;//家庭住址

    public User() {

    }

    public User(Long id, String username, String password, Integer roleId, String phone, int sex, Integer age, String address) {
        this.id = id;
        this.username = username;
        this.password = password;
        this.roleId = roleId;
        this.phone = phone;
        this.sex = sex;
        this.age = age;
        this.address = address;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Integer getRoleId() {
        return roleId;
    }

    public void setRoleId(Integer roleId) {
        this.roleId = roleId;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public int getSex() {
        return sex;
    }

    public void setSex(int sex) {
        this.sex = sex;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", roleId=" + roleId +
                ", phone='" + phone + '\'' +
                ", sex=" + sex +
                ", age=" + age +
                ", address='" + address + '\'' +
                '}';
    }
}
